package com.learner.ucenter;

import com.learner.common.jpa.SimpleJpaRepositoryImpl;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
import org.springframework.data.mongodb.config.EnableMongoAuditing;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
* @Description: 会员模块的启动类
* @Author: ice2020x
* @Date: 2021/10/24
*/
@SpringBootApplication(exclude = {SecurityAutoConfiguration.class})
@EntityScan(basePackages ={"com.learner.pojo.user"})
@MapperScan(basePackages ={"com.learner.ucenter.mapper"})
@EnableJpaRepositories(basePackages = "com.learner.ucenter.repository",repositoryBaseClass = SimpleJpaRepositoryImpl.class)
@ComponentScan(basePackages={"com.learner.common"})
@ComponentScan(basePackages={"com.learner.ucenter"})
@EnableJpaAuditing
@EnableFeignClients
@EnableTransactionManagement
@EnableDiscoveryClient
@EnableMongoAuditing
public class UcenterApplication {
    public static void main(String[] args) {

        SpringApplication.run(UcenterApplication.class, args);
    }

    @Bean
    public BCryptPasswordEncoder bCryptPasswordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
